package com.nexus.ai.gpt.domain;

import lombok.Data;
import org.springframework.ai.chat.prompt.ChatOptions;

/**
 * @Date 2025/9/27 19:33
 * @Author luzhengning
 **/
@Data
public class NexusChatConfig {
    /**
     * 系统角色/人设，例如“我是智能客服”
     *
     * @Date 2025/9/27 19:08
     * @Author luzhengning
     **/
    private String systemMsg;

    /**
     * 多样性系数
     *
     * @Date 2025/9/27 19:36
     * @Author luzhengning
     **/
    private Double temperature = 0.7;
    /**
     * 限制token用量
     *
     * @Date 2025/9/27 19:37
     * @Author luzhengning
     **/
    private Integer maxTokens = 2000;

    /**
     * 其它配置
     *
     * @Date 2025/9/27 19:59
     * @Author luzhengning
     **/
    private ChatOptions options;

    public NexusChatConfig build(String systemMsg) {
        setSystemMsg(systemMsg);
        options = ChatOptions.builder().temperature(temperature).maxTokens(maxTokens).build();
        return this;
    }
}
